import request from '@/utils/request'


export default {
    //讲师列表 条件查询带分页
    //current 当前页 limit 每页记录数 teacherQuery条件对象
    getTeacherListPage(page,size,teacherQuery){
        return request({
            url: `/cmsservice/teachers/pageTeacher/${page}/${size}`,
            method: 'post',
            //后端使用@RequestBody 
            data:teacherQuery
          })
    },
    //根据id删除讲师
    removeById(id) {
        return request({
        url: `/cmsservice/teachers/removeTeacher/${id}`,
        method: 'post'
         })
    },
    //添加讲师
    addTeacher(teacher){
        return request({
            url: `/cmsservice/teachers/addTeacher`,
            method: 'post',
            data:teacher
        })
    },
    //id查询讲师数据回显
    getTeacherInfo(id){
        return request({
            url: `/cmsservice/teachers/getTeacher/${id}`,
            method: 'get'          
        })
    },
    //修改讲师
    updateTeacher(teacher){
        return request({
            url: `/cmsservice/teachers/updateTeacher`,
            method: 'post',
            data:teacher          
        }) 
    },
    //查询所有教师
    findAllTeachers(){
        return request({
            url: `/cmsservice/teachers/findAllTeacher`,
            method: 'GET'        
        }) 
    }
}

